
def longestCommonPrefix(strs):
        if (len(strs) == 1):
            if (strs[0] == ""):
                return ""
            else:
                return strs[0]
        s = ""
        for i in range(len(strs[0])):
            ch = strs[0][i]
            flag = True
            for j in range(1, len(strs)):
                st = strs[j]
                if (i < len(st)):
                    cha = st[i]
                    if (ch != cha):
                        flag = False
                else:
                    flag = False
            if (flag):
                s += cha
            else:
                return s
if __name__ == '__main__':
    s=["",""]
    print(longestCommonPrefix(s))
